/*************    (C) COPYRIGHT SUNSHINE SILICON  www.sunsili.com  *************
* File Name: app_key.h
* Description:
    key funcation
    
* Version    Date       Auther      Reversed History
  ----------------------------------------------------------------------------
  V1.0.0    2021-07-07  Lojam Fan  Fisrt Created 
  
  (C) Sunshine Silicon Corporation (www.sunsili.com)
*******************************************************************************/
#ifndef _APP_KEY_H_
#define _APP_KEY_H_

#include "gpio.h"

#define S1 0x32   //P10 Power ON/OFF
//#define S2 0x14   //P32 Color Switch
//#define S3 0x32   //P33 Mode

#define KEY_SCAN_DUTY 1 //10ms
#define HOLD_5S_TIME  500

typedef enum 
{
    NONE   = (uint8_t)0x00,
    S1_KEY = (uint8_t)0x01,
    S2_KEY = (uint8_t)0x02,
    S3_KEY = (uint8_t)0x04,
}KEY_VAL_t;

typedef enum 
{
    ALL_KEY_FREE = 0,
	POWER_KEY_DOWN,
    POWER_HOLD_5S,
	COLOR_KEY_DOWN,
    MODE_KEY_DOWN,
}key_type;



extern key_type app_key_state;

void app_key_init(void);
void key_state_reset(void);
void key_wakeup_config(void);
void key_wakeup_set(void);
void key_status_check(void);
void app_key_timer_callback(void);


#endif

/*************    (C) COPYRIGHT SUNSHINE SILICON  www.sunsili.com  *************
********************        END OF FILE app_key.h        **********************/
